import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/css/global.css'
import request from "@/utils/request";
import fileDownload from 'js-file-download'
import './utils/global.js'
import { baseAPI } from '@/utils/baseApi'

Vue.config.productionTip = false

Vue.use(ElementUI, {size: "mini"});

Vue.prototype.request = request
Vue.prototype.downloadTemplate = function (templateName) {
    const fileEntity = {
        fileName: templateName, // 文件名称
        // filePath: globalProperties.importTemplate + templateName, // 文件路径
        filePath: 'D:\\workspace\\rank\\springboot\\src\\main\\resources\\templates\\' + templateName, // 文件路径
        downloadChannel: 'xlsx' // 下载类型
    }
    baseAPI.ptsFileDownload(fileEntity).then(response => {
        fileDownload(response.data, templateName)
    }).catch(error => {
        console.log(error)
    })
}
new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
